<template>
    <div class="form">
        <div class="body">
            <div class="l">
                <my-form 
                ref="form"
                v-model="form" 
                label-width="100px"
                label-position="top"
                @submit="submitHandler"
                >
                    <el-form-item
                    label="姓名"
                    prop="name"
                    >
                        <el-input v-model="form.name"></el-input>
                    </el-form-item>

                    <el-form-item
                    label="证件号"
                    prop="orgcode"
                    >
                        <el-input v-model="form.orgcode"></el-input>
                    </el-form-item>

                    <el-form-item
                    label="证件有效期"
                    >
                        <el-date-picker
                            v-model="dateRange"
                            type="daterange"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期"
                            format="yyyy-MM-dd"
                            value-format="yyyy-MM-dd"
                        ></el-date-picker>
                    </el-form-item>

                    <span slot="btn"></span>
                </my-form>
            </div>

            <div class="r">
                <upload-s
                    ref="upload"
                    single
                    filetype=".jpg,.png,.jpeg"
                    :filesize="10"
                    :fileguid="form.fileguid"
                    :extra="uploadExtra"
                ></upload-s>
            </div>
        </div>

        <div class="footer">
            <el-button size="small" type="primary" @click="submit" :loading="submitController">确认</el-button>

            <el-button size="small" @click="close">取消</el-button>
        </div>
    </div>
</template>

<script>
import form from './js/form';

export default form();
</script>

<style lang="scss" scoped>
    @import './style/form.scss';
</style>